package com.itheima.utils;
import java.util.HashMap;

public class JsonResult extends HashMap<String, Object>{
    public JsonResult() {

    }

    public JsonResult(int status, Object data, String msg) {
        this.put("status", status);
        this.put("data", data);
        this.put("msg", msg);
    }
    
    @Override
    public JsonResult put(String key, Object obj) {
    	super.put(key, obj);
    	return this;
    }

    public static JsonResult build(int status, Object data, String msg) {
        return new JsonResult(status, data, msg);
    }

    public int getStatus() {
        return (int)this.get("status");
    }

    public void setStatus(int status) {
        this.put("status", status);
    }

    public Object getData() {
        return this.get("data");
    }

    public void setData(Object data) {
        this.put("data", data);
    }

    public String getMsg() {
        return (String)this.get("msg");
    }

    public void setMsg(String msg) {
        this.put("msg", msg);
    }
}
